home *** CD-ROM | disk | FTP | other *** search
- Delphi MIDI I/O Components Version 2.0b 19 May 1996
- -------------------------- ---------------------------
-
- These components handle low-level MIDI input and output using the
- Windows multimedia MIDI functions. They encapsulate all the nasty
- low-level stuff into some intermediate-level components. They support
- both short MIDI messages (e.g. note on/off, program change) and long
- MIDI messages (e.g. system exclusive, sample dumps).
-
- The components support Delphi 1 and 2. They've been tested in Windows
- 3.1, 95, and NT 3.51.
-
- To install the components:
-
- 1. Use Delphi's Options|Install Components to install MIDIIN.PAS and
- MIDIOUT.PAS. This should give you MIDI input and output components
- on the Samples tab.
-
- 2. Load the project DELPHMID (16-bit version) or DELMID32 (32-bit version)
- and select Compile|Build All to build DELPHMID.DLL or DELMID32.DLL.
-
- 3. Load the project MIDIMON and try running it.
-
- There's no formal documentation, but there are lists of properties,
- methods, and events in the headers of MIDIIN.PAS and MIDIOUT.PAS.
- There's also a couple of example projects: MIDIMON.DPR is a simple
- monitor that demonstrates using components created at design time, and
- MULTIMON.DPR demonstrates using multiple input and output components
- created at runtime.
-
- These components are in the public domain so feel free to produce
- any type of program based on them.
-
- If you need to know more about MIDI you can get a nice package of MIDI
- documentation by sending an email message to listserv@auvm.american.edu
- with the following lines in the message body:
-
- GET MIDI1_0 MIDISPEC
- GET PRIMER MIDISPEC
- GET MIDIBNF MIDISPEC
- GET CTRLTAB MIDISPEC
- GET STATTAB MIDISPEC
- GET NOTESTAB MIDISPEC
- GET FILEFMT MIDISPEC
- GET SDSFMT MIDISPEC
- GET TIMECODE MIDISPEC
-
-
-
- Changes for Delphi 2:
- ---------------------
-
- 1. The TMidiEvent object has been renamed to TMyMidiEvent to avoid a clash
- with the standard Win32 MidiEvent structure and its associated TMidiEvent
- record declaration in Delphi. The GetMidiEvent and PutMidiEvent method
- names are unchanged.
-
- 2. 32-bit DLL name changed to DELMID32.DLL (separate project from
- 16-bit DELPHMID.DLL).
-
- 3. DLL changed to use stdcall declarations for Win32. Other declaration
- changes marked with {$IFDEF WIN32}.
-
- 4. Added support for setting the Technology property in TMidiOut,
- thanks to Fred Kohler.
-
-
- Frequently Asked Questions
- --------------------------
-
- I've had a lot of email about these components. Thanks to everyone
- who sent kind words, code, and bug reports. Here are answers to the
- questions that cropped up most often:
-
- Q: How do you load MIDI files and play them using these components?
-
- A: These components don't do that, and the operating system only
- provides support for playing MIDI files from disk. You need to
- write your own code to load MIDI files. There are lots of C++
- examples around on the net, so get cracking!
-
- Q: I don't want to do anything fancy, I just want to output some MIDI notes,
- how do I do that?
-
- A: These components were mainly built for doing System Exclusive input and
- output so if you don't want to use sysex, you don't really need these
- components to do that, although they make managing the device handles
- slightly easier.
-
- To output notes without the MidiOut component:
- ----------------------------------------------
- 1. Open the device using an integer device ID to specify which
- device. In the example below devID is an integer from 0 to the no. of
- MIDI devices installed (-1). You can get the number of installed devices
- from midiOutGetNumDevs and the names of the devices using
- midiOutGetDevCaps.
-
- var
- devHandle: HMIDIIN;
- midiRes: MMRESULT;
- begin
- { Callbacks not necessary for output }
- devHandle := midiOutOpen( @devHandle, devID, 0, 0, CALLBACK_NULL );
-
- 2. Build up a 32-bit MIDI message value using the MIDI codes defined
- in the MIDI spec (see above for reference).
-
- For example:
-
- theMsg := DWORD(MidiMessage) Or
- (DWORD(MidiData1) shl 8) Or
- (DWORD(MidiData2) shl 16);
-
-
- 3. Output the message using midiOutShortMsg with the handle from
- midiInOpen.
-
- midiRes := midiOutShortMsg( devHandle, theMsg );
-
- 4. Call midiInClose() when you've finished.
-
-
- To output notes using the MidiOutput component:
- -----------------------------------------------
-
- 1. Drop the component on a form.
-
- 2. Set the component's DeviceID or DeviceName properties to set
- the output device, either manually or with code.
- Use the MidiMapper ID (-1) to output to the Windows MIDI Mapper.
-
- 3. Call MidiOutput.Open.
-
- 4. Call Midioutput.PutShort(MidiMessage, Data1, Data2).
-
- 5. Call MidiOutput.Close when you've finished.
-
-
- Contacting me
- -------------
-
- Contact me by email at dchurcher@cix.compulink.co.uk.
-
- Updated versions of this component may appear on my MIDI software web
- page:
-
- http://www.compulink.co.uk/~greenstone/midisoft.htm
-
-
-
- Revision history
- -----------
-
- v2.0b
- -----
- 1. Added 16-bit DCR files in 16bitres.zip
-
- 2. Removed "uses midioutTimerHandler" from delphmid.dpr
-
-
- v2.0
- ----
- 1. Fixed exception on load if the installed MIDI devices were different
- from the development machine.
-
- 2. Now throws an "Invalid device ID" exception on Create if no MIDI
- devices installed on machine.
-
- 3. Fixed GPF when SysexBufferCount = 0
-
-
- David Churcher
- April 1996.
-